//
//  SRSettingHeightView.m
//  SportRing
//
//  Created by Apple on 14/10/24.
//  Copyright (c) 2014年 HotOne. All rights reserved.
//

#import "SRSettingHeightView.h"

@interface SRSettingHeightView (){
    NSInteger currentValue;
}


@property (nonatomic, weak) IBOutlet UILabel *heightLabel;

@end

@implementation SRSettingHeightView

-(void)awakeFromNib
{
    [super awakeFromNib];
    
    NSInteger defaultValue = 175;
    
    [self.heightLabel setTextColor:[UIColor colorWithRed:128.0/255.0 green:204.0/255.0 blue:21.0/255.0 alpha:1.0f]];
    
    [self.srDelegate defaultValue:defaultValue];
}

#pragma mark - ELRulerScrollViewDelegate

-(void)currentValue:(NSInteger)value
{
    [self.heightLabel setText:[NSString stringWithFormat:@"%ldcm",(long)value]];
    
    if (_srDelegate && [_srDelegate respondsToSelector:@selector(currentHeight:)]) {
        
        [_srDelegate currentHeight:value];
    }
}

- (void)didSelectValue:(NSInteger)value
{
    [self.heightLabel setText:[NSString stringWithFormat:@"%ldcm",(long)value]];
    
    if (_srDelegate && [_srDelegate respondsToSelector:@selector(didSelectHeight:)]) {
        
        [_srDelegate didSelectHeight:value];
    }
    
}

@end
